package com.rran.study.designpattern.structural.adapter;

import java.util.HashMap;
import java.util.List;

/**
 * @author yy
 * @Type ListAdapter.java
 * @Desc
 * @date 2020/7/26 21:53
 */
public class ListAdapter extends HashMap {
    private List list;

    public ListAdapter(List list) {
        this.list = list;
    }

    @Override
    public int size() {
        return list.size();
    }

    @Override
    public Object get(Object key) {
        return list.get(Integer.valueOf(key.toString()).intValue());
    }
}
